class_name GameplayMultiwayTransition
extends GameplayStateTransition

##
var _dimensions: Array[Callable]

##
var _state_map: Dictionary


func _init(dimensions: Array[Callable], state_map: Dictionary) -> void:
	_dimensions = dimensions
	_state_map = state_map


func _try_condition() -> bool:
	return true


func _try_transition() -> String:
	var coordinate: Array[int] = []
	for dimension: Callable in _dimensions:
		coordinate.append(dimension.call())
		
	assert(_state_map.has(coordinate), "State map does not have the coordinate: {}!".format(coordinate))

	return _state_map[coordinate]


func _on_transit() -> void:
	pass
